﻿//using System;
//using System.CodeDom;
//using System.Collections.Generic;
//using System.Linq;
//using Microsoft.VisualStudio.TestTools.UnitTesting;
//using wne.core;
//using wne.models;
//using wne.core.Interface;
//using Class1 = wne.core.Class1;


//namespace wne.Tests
//{
//    [TestClass]
//    public class Class1TestWithoutChanges
//    {
//        [TestMethod]
//        public void IsValidLodOnTrue_1_1()
//        {
//            Assert.IsTrue(core.Class1.IsValidLogOn("Log1", "Pass1"), "Такой пользователь не существует");
//        }

//        [TestMethod]
//        public void IsValidLodOnFalse_1_2()
//        {
//            Assert.IsFalse(core.Class1.IsValidLogOn("Log1", "Pass2"), "Такой пользователь существует");
//        }

//        [TestMethod]
//        public void IsValidLogOnNull_1_3()
//        {
//            Assert.IsFalse(core.Class1.IsValidLogOn("", ""), "Пустое поле!");
//        }

//        [TestMethod]
//        public void IsAdminTrue_2_1()
//        {
//            Assert.IsTrue(core.Class1.IsAdmin("Log2"), "Он не является админом!");
//        }

//        [TestMethod]
//        public void IsAdminFalse_2_2()
//        {
//            Assert.IsFalse(core.Class1.IsAdmin("Log1"), "Является админом!");
//        }

//        [TestMethod]
//        public void IsAdminExist_2_3()
//        {
//            Assert.IsFalse(core.Class1.IsAdmin("Log1234"), "Пользователь существует!");
//        }

//        [TestMethod]
//        public void GetGroupByID_minus_one_3_1()
//        {
//            int identif = -1;
//            string sss, warn = "incorrect result";
//            Dictionary<int, string> a = new Dictionary<int, string>();
//            models.GroupModel groupTest = wne.core.Class1.GetGroupById(identif);
//            a = groupTest.AvaliableParents;

//            Assert.IsTrue(a.ContainsKey(1000), warn);
//            a.TryGetValue(1000, out sss);
//            Assert.IsTrue(sss == "All Users", warn);

//            Assert.IsTrue(a.ContainsKey(1001), warn);
//            a.TryGetValue(1001, out sss);
//            Assert.IsTrue(sss == "Admins", warn);

//            Assert.IsTrue(a.ContainsKey(1002), warn);
//            a.TryGetValue(1002, out sss);
//            Assert.IsTrue(sss == "Other", warn);

//            Assert.IsTrue(
//                (a.Count == 3 && groupTest.Id == 0 && groupTest.Name == null && groupTest.SelectedParents == null &&
//                 groupTest.Fields == null), warn);
//        }

//        [TestMethod]
//        public void GetGroupByID_Id_exists_3_2()
//        {
//            int identif = 1001;
//            string sss, warn = "incorrect result";
//            Dictionary<int, string> a = new Dictionary<int, string>();
//            models.GroupModel groupTest = wne.core.Class1.GetGroupById(identif);
//            a = groupTest.AvaliableParents;

//            Assert.IsTrue(a.ContainsKey(1000), warn);
//            a.TryGetValue(1000, out sss);
//            Assert.IsTrue(sss == "All Users", warn);

//            Assert.IsTrue(a.ContainsKey(1002), warn);
//            a.TryGetValue(1002, out sss);
//            Assert.IsTrue(sss == "Other", warn);

//            Assert.IsTrue((a.Count == 2 && groupTest.Id == 1001 && groupTest.Name == "Admins"), warn);

//            List<models.FieldModel> ListOfFields1 = new List<FieldModel>();
//            ListOfFields1 = groupTest.Fields;
//            models.FieldModel field1 = new FieldModel();
//            field1 = ListOfFields1[0];
//            models.FieldType fieldType1 = new models.FieldType();
//            fieldType1 = field1.Type;

//            Assert.IsTrue(
//                (field1.UserCanEdit == false && field1.mandatory == false && field1.Value == "xxx" &&
//                 field1.Name == "b" && fieldType1.id == 2 && fieldType1.name == "bbb"), warn);

//        }

//        [TestMethod]
//        public void GetGroupByID_Id_does_not_exist_3_3()
//        {
//            int identif = 1004;
//            string warn = "incorrect result";
//            models.GroupModel groupTest = wne.core.Class1.GetGroupById(identif);

//            Assert.IsTrue(groupTest == null, warn);
//        }


//        [TestMethod]
//        public void GetAllGroups_one_4_1()
//        {
//            int identif = 1;
//            string warn = "incorrect result";

//            List<models.GroupSmallModel> list1 = wne.core.Class1.GetAllGroups(identif);
//            models.GroupSmallModel group1 = new GroupSmallModel();
//            List<models.FieldModel> ListOfFields1 = new List<FieldModel>();
//            models.FieldModel field1 = new models.FieldModel();
//            models.FieldType fieldType1 = new models.FieldType();

//            //admins
//            group1 = list1[0];
//            ListOfFields1 = group1.Fields;
//            field1 = ListOfFields1[0];
//            fieldType1 = field1.Type;

//            Assert.IsTrue(
//                group1.Id == 1001 && group1.Name == "Admins" && group1.Count == 2 && field1.Name == "b" &&
//                fieldType1.id == 2 && fieldType1.name == "bbb" && field1.Value == "xxx" &&
//                field1.UserCanEdit == false && field1.mandatory == false && group1.Level == 0, warn);
//            //end admins

//            //all users
//            group1 = list1[1];
//            ListOfFields1 = group1.Fields;
//            field1 = ListOfFields1[0];
//            fieldType1 = field1.Type;

//            Assert.IsTrue(
//                group1.Id == 1000 && group1.Name == "All Users" && group1.Count == 0 && field1.Name == "a" &&
//                fieldType1.id == 1 && fieldType1.name == "aaa" && field1.Value == "zzz" &&
//                field1.UserCanEdit == true && field1.mandatory == false && group1.Level == 0, warn);
//            //end all users

//            //other
//            group1 = list1[2];
//            ListOfFields1 = group1.Fields;
//            field1 = ListOfFields1[0];
//            fieldType1 = field1.Type;

//            Assert.IsTrue(
//                group1.Id == 1002 && group1.Name == "Other" && group1.Count == 3 && field1.Name == "c" &&
//                fieldType1.id == 3 && fieldType1.name == "ccc" && field1.Value == "ccc" &&
//                field1.UserCanEdit == true && field1.mandatory == true && group1.Level == 1, warn);
//            //end other
//        }

//        [TestMethod]
//        public void GetAllGroups_two_4_2()
//        {
//            int identif = 2;
//            string warn = "incorrect result";

//            List<models.GroupSmallModel> list1 = wne.core.Class1.GetAllGroups(identif);
//            models.GroupSmallModel group1 = new GroupSmallModel();
//            List<models.FieldModel> ListOfFields1 = new List<FieldModel>();
//            models.FieldModel field1 = new models.FieldModel();
//            models.FieldType fieldType1 = new models.FieldType();

//            //other
//            group1 = list1[0];
//            ListOfFields1 = group1.Fields;
//            field1 = ListOfFields1[0];
//            fieldType1 = field1.Type;

//            Assert.IsTrue(
//                group1.Id == 1002 && group1.Name == "Other" && group1.Count == 3 && field1.Name == "c" &&
//                fieldType1.id == 3 && fieldType1.name == "ccc" && field1.Value == "ccc" &&
//                field1.UserCanEdit == true && field1.mandatory == true && group1.Level == 1, warn);
//            //end other

//            //all users
//            group1 = list1[1];
//            ListOfFields1 = group1.Fields;
//            field1 = ListOfFields1[0];
//            fieldType1 = field1.Type;

//            Assert.IsTrue(
//                group1.Id == 1000 && group1.Name == "All Users" && group1.Count == 0 && field1.Name == "a" &&
//                fieldType1.id == 1 && fieldType1.name == "aaa" && field1.Value == "zzz" &&
//                field1.UserCanEdit == true && field1.mandatory == false && group1.Level == 0, warn);
//            //end all users

//            //admins
//            group1 = list1[2];
//            ListOfFields1 = group1.Fields;
//            field1 = ListOfFields1[0];
//            fieldType1 = field1.Type;

//            Assert.IsTrue(
//                group1.Id == 1001 && group1.Name == "Admins" && group1.Count == 2 && field1.Name == "b" &&
//                fieldType1.id == 2 && fieldType1.name == "bbb" && field1.Value == "xxx" &&
//                field1.UserCanEdit == false && field1.mandatory == false && group1.Level == 0, warn);
//            //end admins

//        }

//        [TestMethod]
//        public void GetAllGroups_three_4_3()
//        {
//            int identif = 3;
//            string warn = "incorrect result";

//            List<models.GroupSmallModel> list1 = wne.core.Class1.GetAllGroups(identif);
//            models.GroupSmallModel group1 = new GroupSmallModel();
//            List<models.FieldModel> ListOfFields1 = new List<FieldModel>();
//            models.FieldModel field1 = new models.FieldModel();
//            models.FieldType fieldType1 = new models.FieldType();

//            //all users
//            group1 = list1[0];
//            ListOfFields1 = group1.Fields;
//            field1 = ListOfFields1[0];
//            fieldType1 = field1.Type;

//            Assert.IsTrue(
//                group1.Id == 1000 && group1.Name == "All Users" && group1.Count == 0 && field1.Name == "a" &&
//                fieldType1.id == 1 && fieldType1.name == "aaa" && field1.Value == "zzz" &&
//                field1.UserCanEdit == true && field1.mandatory == false && group1.Level == 0, warn);
//            //end all users

//            //admins
//            group1 = list1[1];
//            ListOfFields1 = group1.Fields;
//            field1 = ListOfFields1[0];
//            fieldType1 = field1.Type;

//            Assert.IsTrue(
//                group1.Id == 1001 && group1.Name == "Admins" && group1.Count == 2 && field1.Name == "b" &&
//                fieldType1.id == 2 && fieldType1.name == "bbb" && field1.Value == "xxx" &&
//                field1.UserCanEdit == false && field1.mandatory == false && group1.Level == 0, warn);
//            //end admins

//            //other
//            group1 = list1[2];
//            ListOfFields1 = group1.Fields;
//            field1 = ListOfFields1[0];
//            fieldType1 = field1.Type;

//            Assert.IsTrue(
//                group1.Id == 1002 && group1.Name == "Other" && group1.Count == 3 && field1.Name == "c" &&
//                fieldType1.id == 3 && fieldType1.name == "ccc" && field1.Value == "ccc" &&
//                field1.UserCanEdit == true && field1.mandatory == true && group1.Level == 1, warn);
//            //end other

//        }

//        [TestMethod]
//        public void GetAllGroups_four_4_4()
//        {
//            int identif = 4;
//            string warn = "incorrect result";

//            List<models.GroupSmallModel> list1 = wne.core.Class1.GetAllGroups(identif);
//            models.GroupSmallModel group1 = new GroupSmallModel();
//            List<models.FieldModel> ListOfFields1 = new List<FieldModel>();
//            models.FieldModel field1 = new models.FieldModel();
//            models.FieldType fieldType1 = new models.FieldType();

//            //other
//            group1 = list1[0];
//            ListOfFields1 = group1.Fields;
//            field1 = ListOfFields1[0];
//            fieldType1 = field1.Type;

//            Assert.IsTrue(
//                group1.Id == 1002 && group1.Name == "Other" && group1.Count == 3 && field1.Name == "c" &&
//                fieldType1.id == 3 && fieldType1.name == "ccc" && field1.Value == "ccc" &&
//                field1.UserCanEdit == true && field1.mandatory == true && group1.Level == 1, warn);
//            //end other

//            //admins
//            group1 = list1[1];
//            ListOfFields1 = group1.Fields;
//            field1 = ListOfFields1[0];
//            fieldType1 = field1.Type;

//            Assert.IsTrue(
//                group1.Id == 1001 && group1.Name == "Admins" && group1.Count == 2 && field1.Name == "b" &&
//                fieldType1.id == 2 && fieldType1.name == "bbb" && field1.Value == "xxx" &&
//                field1.UserCanEdit == false && field1.mandatory == false && group1.Level == 0, warn);
//            //end admins

//            //all users
//            group1 = list1[2];
//            ListOfFields1 = group1.Fields;
//            field1 = ListOfFields1[0];
//            fieldType1 = field1.Type;

//            Assert.IsTrue(
//                group1.Id == 1000 && group1.Name == "All Users" && group1.Count == 0 && field1.Name == "a" &&
//                fieldType1.id == 1 && fieldType1.name == "aaa" && field1.Value == "zzz" &&
//                field1.UserCanEdit == true && field1.mandatory == false && group1.Level == 0, warn);
//            //end all users

//        }

//        [TestMethod]
//        public void GetAllGroups_more_then_four_4_5()
//        {
//            int identif = 8;
//            string warn = "incorrect result";

//            List<models.GroupSmallModel> list1 = wne.core.Class1.GetAllGroups(identif);
//            models.GroupSmallModel group1 = new GroupSmallModel();
//            List<models.FieldModel> ListOfFields1 = new List<FieldModel>();
//            models.FieldModel field1 = new models.FieldModel();
//            models.FieldType fieldType1 = new models.FieldType();

//            //other
//            group1 = list1[0];
//            ListOfFields1 = group1.Fields;
//            field1 = ListOfFields1[0];
//            fieldType1 = field1.Type;

//            Assert.IsTrue(
//                group1.Id == 1002 && group1.Name == "Other" && group1.Count == 3 && field1.Name == "c" &&
//                fieldType1.id == 3 && fieldType1.name == "ccc" && field1.Value == "ccc" &&
//                field1.UserCanEdit == true && field1.mandatory == true && group1.Level == 1, warn);
//            //end other

//            //admins
//            group1 = list1[1];
//            ListOfFields1 = group1.Fields;
//            field1 = ListOfFields1[0];
//            fieldType1 = field1.Type;

//            Assert.IsTrue(
//                group1.Id == 1001 && group1.Name == "Admins" && group1.Count == 2 && field1.Name == "b" &&
//                fieldType1.id == 2 && fieldType1.name == "bbb" && field1.Value == "xxx" &&
//                field1.UserCanEdit == false && field1.mandatory == false && group1.Level == 0, warn);
//            //end admins

//            //all users
//            group1 = list1[2];
//            ListOfFields1 = group1.Fields;
//            field1 = ListOfFields1[0];
//            fieldType1 = field1.Type;

//            Assert.IsTrue(
//                group1.Id == 1000 && group1.Name == "All Users" && group1.Count == 0 && field1.Name == "a" &&
//                fieldType1.id == 1 && fieldType1.name == "aaa" && field1.Value == "zzz" &&
//                field1.UserCanEdit == true && field1.mandatory == false && group1.Level == 0, warn);
//            //end all users

//        }

//        [TestMethod]
//        public void UpdateOrAddGroup_commas_6_3()
//        {
//            string warn = "incorrect result";

//            Assert.IsNull(core.Class1.UpdateOrAddGroup("1000", "test", "1001,1002", "fieldTest1",
//                "21,12,22,45,78,90", "true,false", "false", "gdg,dgd,ddd,fff"), warn);
//        }
//        [TestMethod]
//        public void UpdateOrAddGroup_something_but_not_true_or_false_6_4()
//        {
//            string warn = "incorrect result";

//            Assert.IsNull(core.Class1.UpdateOrAddGroup("1000", "test", "1001", "fieldTest1",
//                "21", "black", "leg", "gdg"), warn);
//        }
//        [TestMethod]
//        public void UpdateOrAddGroup_id_not_exists_6_5()
//        {
//            string warn = "incorrect result";

//            Assert.IsNull(core.Class1.UpdateOrAddGroup("94321", "test", "1001", "fieldTest1",
//                "21", "black", "leg", "gdg"), warn);
//            Assert.IsNull(core.Class1.UpdateOrAddGroup("1000", "test", "94321", "fieldTest1",
//                "21", "black", "leg", "gdg"), warn);
//        }

//        [TestMethod]
//        public void GetUserById_minus_one_7_1()
//        {
//            string sss, warn = "incorrect result";

//            models.EditUser test1 = GetUserById(-1);

//            Dictionary<int, string> a = new Dictionary<int, string>();
//            a = test1.AllGroups;

//            Assert.IsTrue(a.ContainsKey(1000), warn);
//            a.TryGetValue(1000, out sss);
//            Assert.IsTrue(sss == "All Users", warn);

//            Assert.IsTrue(a.ContainsKey(1001), warn);
//            a.TryGetValue(1001, out sss);
//            Assert.IsTrue(sss == "Admins", warn);

//            Assert.IsTrue(a.ContainsKey(1002), warn);
//            a.TryGetValue(1002, out sss);
//            Assert.IsTrue(sss == "Other", warn);

//            Assert.IsTrue(
//                (a.Count == 3 && test1.Id == 0 && test1.User_Name == null && test1.User_Email == null && 
//                test1.User_Fields==null && test1.User_BD==null && test1.Groups==null && test1.SelectedValue==0
//                ), warn);
//         }

//        [TestMethod]
//        public void GetUserById_not_minus_one_7_2()
//        {
//            string sss, warn = "incorrect result";

//            models.EditUser test1 = GetUserById(1001);

//            Dictionary<int, string> allgroupsTest = new Dictionary<int, string>();
//            allgroupsTest = test1.AllGroups;

//            List<Group_Field> User_Fields1 = new List<Group_Field>();
//            User_Fields1 = test1.User_Fields;
//            Group_Field group_field1 = new Group_Field();
//            group_field1 = User_Fields1[0];
//            List<FieldModel> fields1 = new List<FieldModel>();
//            fields1 = group_field1.Fields;
//            FieldModel field1 = new FieldModel();
//            field1 = fields1[0];
//            FieldType type1 = new FieldType();

//            List<IntString> Groups1 = new List<IntString>();
//            Groups1 = test1.Groups;
//            IntString is1 = new IntString();
//            is1 = Groups1[0];

//            Assert.IsTrue(
//                test1.Id == 1001 && test1.User_Name == "Log2" && test1.User_Email == "mail2@mail.ru" && test1.User_BD == "02.01.1991" &&
//                is1.i == 1001 && is1.s == "Admins" && Groups1.Count == 1 &&
//                group_field1.Id == 1001 && group_field1.Name == "Admins" &&
//                field1.Name == "b" && type1.id == 2 && field1.Value == "xxx" &&
//                field1.UserCanEdit == false && field1.mandatory == false &&
//                fields1.Count == 1 && allgroupsTest.Count == 2
//                , warn);
            
//            Assert.IsTrue(allgroupsTest.ContainsKey(1000), warn);
//            allgroupsTest.TryGetValue(1000, out sss);
//            Assert.IsTrue(sss == "All Users", warn);

//            Assert.IsTrue(allgroupsTest.ContainsKey(1002), warn);
//            allgroupsTest.TryGetValue(1002, out sss);
//            Assert.IsTrue(sss == "Other", warn);
            
//        }

//        [TestMethod]
//        public void GetUserById_not_exists_7_3()
//        {
//            string warn = "incorrect result";
//            Assert.IsNull(GetUserById(93423), warn);
            
//        }

//    }
//}